﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Com.Framework;
using Com.Library.DB.Post;

namespace Com.Web.coffinegurunaru.popup
{
	public partial class pop_address : System.Web.UI.Page
	{
		protected string CallBackFuncName { get; set; }
		protected string SearchWord { get; set; }
		protected List<PostEntity> List { get; set; }
		protected void Page_Load(object sender, EventArgs e)
		{
			CallBackFuncName = Request["callback"].Parse(string.Empty);
			SearchWord = string.Empty;
			if (this.IsPostBack)
			{
				string errorMsg = string.Empty;
				SearchWord = Request.Form["searchWord"].Parse(string.Empty);
				try
				{
					if (SearchWord != string.Empty)
						List = PostModel.GetList(SearchWord);
				}
				catch (Exception ex)
				{
					errorMsg = ex.Message;
				}

				if (errorMsg != "")
				{
					ClientScript.RegisterStartupScript(this.GetType(), "error", "alert('" + errorMsg + "');", true);
					return;
				}
			}
		}
	}
}
